package com.example.home.repository

import com.example.base.bean.ResponseResult
import com.example.base.ext.extRequestHttp
import com.example.base.base.viewmodel.BaseRepository
import com.example.common.network.Api
import com.example.home.bean.request.Location
import com.example.home.bean.request.MarkerCardRequest
import com.example.home.bean.respose.Marker
import com.example.home.bean.respose.MarkerCard
import com.example.home.service.MapService

/**
 * @Description
 * @department 城市元宇宙组
 * @Author niushilong
 * @Date 2024-04-05 13:15
 */
class HomeRepository: BaseRepository() {

    private val mapService: MapService = Api.getService(MapService::class.java)

    suspend fun getMarkerList(location: Location): ResponseResult<List<Marker>> {
        return extRequestHttp {
            mapService.getMarkerList(location)
        }
    }

    suspend fun getMarkerCardList(request: MarkerCardRequest): ResponseResult<List<MarkerCard>> {
        return extRequestHttp {
            mapService.getMarkerCardList(request)
        }
    }
}